﻿using System;
using System.ComponentModel;

namespace Farinfo.Infrastructure
{
    /// <summary>
    /// 执行结果
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class RunResult<T>
    {
        /// <summary>
        /// 操作状态
        /// </summary>
        public ResultStatus Status { get; set; }
        /// <summary>
        /// 操作异常
        /// </summary>
        public Exception Exception { get; set; }
        /// <summary>
        /// 数据结果
        /// </summary>
        public T Result { get; set; }
        /// <summary>
        /// 操作消息
        /// </summary>
        public string Message { get; set; }
    }

    public class RunResult : RunResult<dynamic>
    {

    }

    /// <summary>
    /// 
    /// </summary>
    public enum ResultStatus
    {
        /// <summary>
        /// 失败
        /// </summary>
        [Description("失败")]
        Failure,
        /// <summary>
        /// 成功
        /// </summary>
        [Description("成功")]
        Success,
        /// <summary>
        /// 异常
        /// </summary>
        [Description("异常")]
        Abnormal,
        /// <summary>
        /// 超时
        /// </summary>
        [Description("超时")]
        Timeout,
    }
}